'''编写代码,实现计算器的四则运算功能'''
def calculator():
    num1 = float(input('请输入第一个数字:'))
    method = input('请输入运算符号:')
    num2 = float(input('请输入第二个数字:'))
    if method == '+':
        result = num1 + num2
        print(f'计算结果为:num1 + num2 = {result}')
    elif method == '-':
        result = num1 - num2
        print(f'计算结果为:num1 - num2 = {result}')
    elif method == '×':
        result = num1 * num2
        print(f'计算结果为:num1 × num2 = {result}')
    elif method == '÷':
        result = num1 / num2
        print(f'计算结果为:num1 ÷ num2 = {result}')
calculator()